package com.bit101.components
{
	import flash.display.DisplayObjectContainer;
	import flash.events.MouseEvent;
	
	public class MySlider extends Slider
	{
		public function MySlider(orientation:String=Slider.HORIZONTAL, parent:DisplayObjectContainer=null, xpos:Number=0, ypos:Number=0, defaultHandler:Function=null)
		{
			super(orientation, parent, xpos, ypos, defaultHandler);
		}
		override protected function drawHandle():void
		{	
			_handle.graphics.clear();
			//_handle.graphics.beginFill(Style.BUTTON_FACE);//333333
			_handle.graphics.beginFill(0x333333);
			if(_orientation == HORIZONTAL)
			{
				//_handle.graphics.drawRect(1, 1, _height - 2, _height - 2);
				_handle.graphics.drawCircle(4,6,6);
			}
			else
			{
				_handle.graphics.drawRect(1, 1, _width - 2, _width - 2);
			}
			_handle.graphics.endFill();
			positionHandle();
		}
		override protected function drawBack():void
		{
			_back.graphics.clear();
			_back.graphics.beginFill(0x333333);
			_back.graphics.drawRect(0, 4, _width, 4);
			_back.graphics.endFill();
			
			if(_backClick)
			{
				_back.addEventListener(MouseEvent.MOUSE_DOWN, onBackClick);
			}
			else
			{
				_back.removeEventListener(MouseEvent.MOUSE_DOWN, onBackClick);
			}
		}
	}
}